package com.mycompany.inventory.pojo;

import java.util.ArrayList;
import java.util.List;

public class Vendor {
	
	private String Id;
	private String name;
	private Integer balance;
	private Address address = new Address();
	private List<Address> addresses = new ArrayList<Address>();
	private Contact contact = new Contact();
	private List<CustomInfo> customs = new ArrayList<CustomInfo>();
	private String remark;
	private PaymentTerm paymentTerm;
	private TaxScheme taxingScheme;
	private Carrier carrier;
	private Currency currency;
	private boolean deleted;
		
	public Vendor() {
		
	}

	public Vendor(String id, String name) {
		this.Id = id;
		this.name = name;
	}
	
	public Vendor(String id, String name, Integer balance, List<Address> addresses,
			Contact contact, List<CustomInfo> customs, String remark,
			PaymentTerm paymentTerm, TaxScheme taxingScheme, Carrier carrier,
			Currency currency) {
		this.name = name;
		this.balance = balance;
		this.addresses = addresses;
		if(this.addresses!=null && this.addresses.size() > 0)
			this.address = this.addresses.get(0);
		this.contact = contact;
		this.customs = customs;
		this.remark = remark;
		this.paymentTerm = paymentTerm;
		this.taxingScheme = taxingScheme;
		this.carrier = carrier;
		this.currency = currency;
		this.Id = id;
		this.deleted = false;
	}
	
	public void copyValue(Vendor vendor){
		this.name = vendor.getName();
		this.balance = vendor.getBalance();
		this.addresses = vendor.getAddresses();
		if(this.addresses!=null && this.addresses.size() > 0)
			this.address = this.addresses.get(0);
		this.contact = vendor.getContact();
		this.customs = vendor.getCustoms();
		this.remark = vendor.getRemark();
		this.paymentTerm = vendor.getPaymentTerm();
		this.taxingScheme = vendor.getTaxingScheme();
		this.carrier = vendor.getCarrier();
		this.currency = vendor.getCurrency();
		this.Id = vendor.getId();
		this.deleted = vendor.isDeleted();
	}
	
	public String getId() {
		return Id;
	}

	public void setId(String id) {
		Id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getBalance() {
		return balance;
	}

	public void setBalance(Integer balance) {
		this.balance = balance;
	}

	public List<Address> getAddresses() {
		return addresses;
	}

	public void setAddresses(List<Address> addresses) {
		this.addresses = addresses;
	}
	
	public Address getAddress() {
		return address;
	}

	public void setAddress(Address address) {
		this.address = address;
	}

	public Contact getContact() {
		return contact;
	}

	public void setContact(Contact contact) {
		this.contact = contact;
	}

	public List<CustomInfo> getCustoms() {
		return customs;
	}

	public void setCustoms(List<CustomInfo> customs) {
		this.customs = customs;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public PaymentTerm getPaymentTerm() {
		return paymentTerm;
	}

	public void setPaymentTerm(PaymentTerm paymentTerm) {
		this.paymentTerm = paymentTerm;
	}

	public TaxScheme getTaxingScheme() {
		return taxingScheme;
	}

	public void setTaxingScheme(TaxScheme taxingScheme) {
		this.taxingScheme = taxingScheme;
	}

	public Carrier getCarrier() {
		return carrier;
	}

	public void setCarrier(Carrier carrier) {
		this.carrier = carrier;
	}

	public Currency getCurrency() {
		return currency;
	}

	public void setCurrency(Currency currency) {
		this.currency = currency;
	}

	public String toString(){
		return name;
	}
	
	public boolean isDeleted() {
		return deleted;
	}

	public void setDeleted(boolean deleted) {
		this.deleted = deleted;
	}
}